package com.initialize.appapi;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.swing.*;

@EnableSwagger2
@ServletComponentScan
@SpringBootApplication(scanBasePackages = "com.initialize")
@MapperScan("com.initialize.pub")
public class InitializeAppapiApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        JEditorPane response = new JEditorPane();
        response.setContentType("application/json;charset=utf-8");
        SpringApplication.run(InitializeAppapiApplication.class, args);
    }


    /**
     * 一下是在服务器需要部署HTTPS的情况下使用
     *
     */
    //配置http
//    @Bean
//    public ServletWebServerFactory servletContainer() {
//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
//        // 添加http
//        tomcat.addAdditionalTomcatConnectors(createStandardConnector());
//        return tomcat;
//    }
//
//
//    private Connector createStandardConnector() {
//        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//        connector.setPort(8081);
//        return connector;
//    }


}
